<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <style>
      .nav {
        list-style: none;
        display: flex;
        justify-content: space-between;
        background-color: #66ccff;
      }

      .actived {
        color: red;
      }
    </style>
  </head>

  <body>
    <div id="app">
      <ul class="nav">
        <li v-for="(item,index) in list" :class="{actived:active==index}" @click="change(index)">{{item}}</li>
      </ul>
    </div>
  </body>
  <script>
    let vue = new Vue({
      el: '#app',
      data: {
        active: 0,
        list: ['全部', '动画区', '鬼畜区', '音乐区']
      },
      methods: {
        change(index) {
          this.active = index
        }
      }
    })
  </script>
</html>
